{% extends "fb/base.html" %}

<!--header of the page-->
{% block title %}意见录入页{% endblock %}

<!--content of the page-->
{% block content %}
<script language="javascript"> 
function checkvalue() { 
  if (document.msgform.subject.value=="") {
     alert("主题不能为空") ;
     document.msgform.subject.focus(); 
     return false; 
   } 
  if (document.msgform.message.value=="") {
     alert("评论内容不能为空");
     document.msgform.message.focus(); 
     return false; 
      
   } 
   return true ; 
}
</script> 

 <form name="msgform" action="/feedback" method="post" >
       <table>
          <tr><td> 您的名称: </td><td><input size=30 type="text" name="username"></td></tr>
          <tr><td> 您的Email: </td><td><input size=30 type="text" name="email"></td></tr>
          <tr><td>主题:</td><td> <input size=80 type="text" name="subject"></td></tr>
          <tr><td>留言内容:</td><td> <textarea name="message" rows="18" cols="60"></textarea></td></tr>
	  <tr><td  align=center colspan=2> <input type="submit" value="Submit" onClick="return checkvalue();"></td></tr>
       </table>
 </form>

 {%for r in list.object_list %}
   <li>
   <span class="pname"><a class="blue">{{r.title}} {{r.username}}</a></span>
   <span class="sname">{{r.content}}</span>
   <span class="crank">{{r.datetime}}</span>
   <div style="clear:both"></div>
   </li>
 {%endfor%}

  {% if list.has_previous %}
            <a href="?page={{ list.previous_page_number }}">previous</a>
  {% endif %}
  <span class="current">
            Page {{ list.number }} of {{ list.paginator.num_pages }}
  </span>
  {% if list.has_next %}
            <a href="?page={{ list.next_page_number }}">next</a>
  {% endif %}  
{% endblock %}

